home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 21 / CU Amiga Magazine's Super CD-ROM 21 (1998)(EMAP Images)(GB)[!][issue 1998-04].iso / CUCD / Games / DoomGate / HD-Install / DoomGATE.rexx < prev    next >
OS/2 REXX Batch file  |  1998-02-08  |  30KB  |  989 lines

  1. /*
  2. $VER: DoomGATE 0.8r1 (8.2.98)
  3.  
  4. don't edit this file. i can't stop you from looking, but don't touch.
  5. if you wanna suggest a change, mail it me. although most of this is
  6. changing as we speak... 
  7.  
  8. pcomm@inorbit.com
  9.  
  10. */
  11. options results
  12. if exists("libs:rexxarplib.library") then addlib("rexxarplib.library",0,-30,0)
  13. call Tags()
  14. call LoadPortsData()
  15. if ~exists('env:doomgate') then address command 'makedir env:DoomGate'
  16. if ~exists('envarc:doomgate') then address command 'makedir envarc:DoomGate'
  17. if arg(1)="DOOMRCLOAD" then do
  18.     call DOOMRC(READ)
  19. exit
  20. end
  21. if arg(1)="DOOMRCSAVE" then do
  22.     call DOOMRC(SAVE)
  23. exit
  24. end
  25. if arg(1)="SETTINGSFETCH" then do
  26. options results;address DOOMGATE;
  27. string ID FSS;
  28. ip = result;
  29. window ID DOOF close;
  30. address command 'type tcp:'ip'/5152 >t:dg_temp';
  31. if open(set,'t:dg_temp',r) then do;
  32. set = readln(set);
  33. call close(set);
  34. window ID DOOS Title '"Settings From Remote"' COMMAND '"window ID DOOS close"' PORT DOOMGATE;
  35. button label "\033c Settings Used at" IP "\n" set;
  36. endwindow;
  37. end;
  38. exit
  39. end
  40. if arg(1)="OFFERDETAILS" then do
  41.     address DOOMGATE;string id COTH;
  42.     ct = result
  43. button id FOSO ATTRS MUIA_Disabled 1
  44. object id FOSB ATTRS MUIA_Busy_Speed 2
  45. call getchecks()
  46. address DOOMGATE
  47. check id CWAR
  48. if result = 1 then do
  49.     ct = ct || " -warp "
  50.     slider ID WARE
  51.     ct = ct || result || " "
  52.     slider ID WARM
  53.     ct = ct || result
  54. end
  55. check id CSKI
  56. if result = 1 then do
  57.     ct = ct || " -skill "
  58.     slider ID SKIL
  59.     ct = ct || result
  60. end
  61. check id CFIL
  62. if result = 1 then do
  63.     ct = ct || " -file "
  64.     popasl ID PFIL
  65.     ct = ct || result
  66. end
  67. check ID CTUB
  68. if result = 1 then do
  69.     ct = ct || " -turbo "
  70.     slider ID TURB
  71.     ct = ct || result
  72. end
  73. radio ID NAMT
  74. nodes = result
  75. if nodes ~= 1 then do
  76. radio ID NAMP
  77. playernumber = result
  78. ct = ct || " -net "||playernumber||" "
  79. end
  80. address command 'echo >tcp:5152 'ct
  81. button id FOSO ATTRS MUIA_Disabled 0
  82. object id FOSB ATTRS MUIA_Busy_Speed 0
  83. EXIT
  84. end
  85. if arg(1)="SETTINGSFETCH" then do
  86. options results;address DOOMGATE;
  87. string ID FSS;
  88. ip = result;
  89. window ID DOOF close;
  90. address command 'type tcp:'ip'/5152 >t:dg_temp';
  91. if open(set,'t:dg_temp',r) then do;
  92. set = readln(set);
  93. call close(set);
  94. window ID DOOS Title '"Settings From Remote"' COMMAND '"window ID DOOS close"' PORT DOOMGATE;
  95. label "\033c Settings Used at" IP;
  96. label "\033l" set;
  97. endwindow;
  98. end;
  99. exit
  100. end
  101. if arg(1)="SETTINGSFETCHWIN" then do
  102. options results;address DOOMGATE;
  103. window ID DOOF TITLE '"Fetch Settings"' COMMAND '"window ID DOOF close"' PORT DOOMGATE ATTRS MUIA_Window_ScreenTitle '"DoomGATE v0.8r1ß          ©1998 Piper Communications Freely Distributable Emailware"';
  104. group horiz;
  105. label "Enter IP or Hostname";
  106. button ID FSB COMMAND '"DoomGATE.rexx SETTINGSFETCH"' ATTRS MUIA_CycleChain 1 label "Fetch from this IP"
  107. endgroup;
  108. string ID FSS ATTRS MUIA_CycleChain 1
  109. endwindow
  110. exit
  111. end
  112. if arg(1)="SETTINGSUNBODGE" then do
  113. options results;address DOOMGATE;
  114. button id FOSO ATTRS MUIA_Disabled 0
  115. object id FOSB ATTRS MUIA_Busy_Speed 0
  116. address command 'run <>NIL: type tcp:localhost/5152'
  117. exit
  118. end
  119. if arg(1)="STARTDOOM" then do
  120.     address DOOMGATE;string id COTH;
  121.     ct = result
  122. say "--Getting info from GUI--"
  123. call getchecks()
  124. address DOOMGATE
  125. check id CWAR
  126. if result = 1 then do
  127.     say "--Collecting WARP info from GUI--"
  128.     ct = ct || " -warp "
  129.     slider ID WARE
  130.     ct = ct || result || " "
  131.     slider ID WARM
  132.     ct = ct || result
  133. end
  134. check id CSKI
  135. if result = 1 then do
  136. say "--Collecting Skill info from GUI--"
  137.     ct = ct || " -skill "
  138.     slider ID SKIL
  139.     ct = ct || result
  140. end
  141. check id CFIL
  142. if result = 1 then do
  143. say "--Collecting Custom WAD info from GUI--"
  144.     ct = ct || " -file "
  145.     popasl ID PFIL
  146.     ct = ct || result
  147. end
  148. check ID CTUB
  149. if result = 1 then do
  150. say "--Collecting Turbo info from GUI--"
  151.     ct = ct || " -turbo "
  152.     slider ID TURB
  153.     ct = ct || result
  154. end
  155. say "--Now checking for number of Players--"
  156. radio ID NAMT
  157. nodes = result
  158. say "--There are "nodes" Nodes Set--"
  159. if nodes ~= 1 then do
  160.     say "--So networking is needed--"
  161. radio ID NAMP
  162. playernumber = result
  163.     ct = ct || " -net "||playernumber||" "
  164. if playernumber > nodes then do
  165.     say "--ERROR. Player Number ["playernumber"] does NOT EXIST--"
  166.     say "PLEASE RESELECT PLAYER NUMBER AND TRY AGAIN........."
  167.     exit
  168. end
  169.     if nodes > 1 then do
  170.     if playernumber = 1 then break
  171.     string ID NOD1
  172.     nodeip = result
  173.     say "--Adding "nodeip"--"
  174.     ct = ct || nodeip || " "
  175.     end
  176.     if nodes > 1 then do
  177.     if playernumber = 2 then break
  178.     string ID NOD2
  179.     nodeip = result
  180.     say "--Adding "nodeip"--"
  181.     ct = ct || nodeip || " "
  182.     end
  183.     if nodes > 2 then do
  184.     if playernumber = 3 then break
  185.     string ID NOD3
  186.     nodeip = result
  187.     say "--Adding "nodeip"--"
  188.     ct = ct || nodeip || " "
  189.     end
  190.     if nodes > 3 then do
  191.     if playernumber = 4 then break
  192.     string ID NOD4
  193.     nodeip = result
  194.     say "--Adding "nodeip"--"
  195.     ct = ct || nodeip || " "
  196.     end    
  197.     if nodes > 4 then do
  198.     if playernumber = 5 then break
  199.     string ID NOD5
  200.     nodeip = result
  201.     say "--Adding "nodeip"--"
  202.     ct = ct || nodeip || " "
  203.     end
  204. end
  205. check ID NPRC
  206. if result = 1 then do
  207. string ID NPRS
  208. newport = result
  209. say "--New port ("newport")--"
  210. ct = ct || " -port " || newport || " "
  211. end
  212. say "--Got info ("ct")--"
  213. say "--Checking Which Port to Use--"
  214. button id PLSB
  215. useme = result
  216. if ports.0 ~= -1 then do
  217.     do i=1 for ports.0
  218.       if ports.i = useme then break
  219.     end
  220. end
  221. say ports.i
  222. say exe.i
  223. say dir.i
  224. say "--Changing Directory--"
  225. say "--New dir is ["dir.i"]--"
  226.     call pragma(d,dir.i)
  227. say "--Setting new Stack--"
  228.     Address DOOMGATE knob id STAC ATTRS MUIA_Slider_Level
  229.     newstack = result
  230. say "--New Stack is ["newstack"]--"
  231.     call pragma(S,newstack)
  232.     parse var dir.i drive ":" rest
  233.     drive = drive || ":"
  234. say "--Caculating Buffer Change--"
  235.     say drive
  236.     address command
  237.     'addbuffers 'drive' >t:buffers'
  238.     if ~open(buffers,'t:buffers',r) then do
  239.         say "Buggered. Addbuffers didnt work. Buggered."
  240.         exit
  241.     end
  242.     buffs = readln(buffers)
  243.     buffs = word(buffs,3)
  244.     call close(buffers)
  245.     address command 'delete t:buffers <>NIL: quiet'
  246.     say buffs " currently on drive."
  247.     Address DOOMGATE knob id BUFS ATTRS MUIA_Slider_Level
  248.     newbuff = result
  249.     buffchange = newbuff - buffs
  250.     say "Need to add "buffchange" buffers."
  251. say "--Changing Buffers--"
  252.     address command 'addbuffers 'drive buffchange
  253. say "--Final Commandline is ("exe.i ct")--"
  254. say "--Kicking up DOOM--"
  255.     exe.i ct;
  256.     exit;
  257. end
  258. Max_Episode = GetEnv("DoomGate/Episodes")
  259. If Max_Episode = " " then Max_Episode = 3
  260. address DOOMGATE
  261. MUIA_Window_ScreenTitle =              0x804234b0 
  262. window ID DOOM TITLE '"DoomGATE v0.8r1ß"' COMMAND '"quit"' PORT DOOMGATE ATTRS MUIA_Window_ScreenTitle '"DoomGATE v0.8r1ß          ©1998 Piper Communications Freely Distributable Emailware"'
  263. menu LABEL "Project"
  264.     item COMMAND '"method 'MUIM_Application_AboutMUI' 0"' PORT DOOMGATE LABEL "About MUI"
  265. menu LABEL "Settings"
  266. item COMMAND '"copy env:doomgat#? envarc: all quiet"' PORT Command  ATTRS MUIA_Menuitem_Shortcut 'S' LABEL "Save DoomGATE..."
  267. item ATTRS MUIA_Menuitem_Title '-1'
  268. item COMMAND '"method 'MUIM_Application_OpenConfigWindow'"' PORT DOOMGATE LABEL "Edit MUI..."
  269. endmenu
  270. item ATTRS MUIA_Menuitem_Title '-1'
  271. item COMMAND '"quit"' PORT DOOMGATE ATTRS MUIA_Menuitem_Shortcut 'Q' LABEL "Quit"
  272. endmenu
  273. text help '"This is DoomGATE 0.8r1 BETA by\nPiper Communications (http://pcomm.home.ml.org/)\nIf you use this program, you are required to\nEmail the author (pcomm@inorbit.com). Otherwise,\nhow is he supposed to know to keep supporting\nDoomGATE ?!?\n\033rNicholas Piper"',
  274. label "\033c\033bDoomGATE 0.8r1ß\033n\n\033cPiper Communications\n\033cFreely Distributable Emailware"
  275. group REGISTER ID MAIR  ATTRS MUIA_CycleChain 1 LABELS "Game,Information,Settings,Network,WADS"
  276. group 
  277. group frame label "Command Line Options"
  278. group
  279. group horiz ATTRS MUIA_Group_Columns 8
  280. call GetChecksIntoGUI()
  281. endgroup 
  282. space horiz bar
  283. group  ATTRS MUIA_Group_Columns 4
  284.     label single   "-warp"
  285.     group  ATTRS MUIA_Group_Columns 2
  286.     check ID CWAR HELP '"Warp to Stage"' PORT INLINE,
  287. COMMAND """if %s = 0 then do;
  288. address doomgate slider ID WARE ATTRS '0x80423661' 1;
  289. address doomgate slider ID WARM ATTRS '0x80423661' 1;
  290. end;
  291. else do;
  292. address doomgate slider ID WARE ATTRS '0x80423661' 0;
  293. address doomgate slider ID WARM ATTRS '0x80423661' 0;
  294. end"""
  295.     group horiz
  296.         group
  297.         slider ID WARE HELP '"Episode to Warp To (E\033b#\033nL#)"' ATTRS MUIA_Slider_Min 1 MUIA_Slider_Max Max_Episode
  298.         endgroup
  299.         group
  300.         slider ID WARM HELP '"Level to Warp To (E#L\033b#\033n)"' ATTRS MUIA_Slider_Min 1 MUIA_Slider_Max 9
  301.         endgroup
  302.     endgroup
  303.     endgroup
  304.     label single   "-skill"
  305.     group ATTRS MUIA_Group_Columns 2
  306.     check ID CSKI HELP '"Skill Level"' PORT INLINE,
  307. COMMAND """if %s = 0 then address doomgate slider ID SKIL ATTRS '0x80423661' 1;
  308. else address doomgate slider ID SKIL ATTRS '0x80423661' 0"""
  309.     slider ID SKIL HELP '"Skill Level to Set"' ATTRS MUIA_Slider_Min 1 MUIA_Slider_Max 5
  310.     endgroup
  311.     label single "-file"
  312.     group  ATTRS MUIA_Group_Columns 2
  313.     check ID CFIL HELP '"Use custom WAD ?"' PORT INLINE,
  314. COMMAND """if %s = 0 then address doomgate popasl ID PFIL ATTRS '0x80423661' 1;
  315. else address doomgate popasl ID PFIL ATTRS '0x80423661' 0"""
  316.     popasl ID PFIL help '"Full Path to custom WAD"' Command '"setenv DoomGate/Custom_WAD %s"' port command
  317.     endgroup
  318.     label single   "-turbo"
  319.     group     ATTRS MUIA_Group_Columns 2
  320.     check ID CTUB HELP '"Makes your Marine Faster"' PORT INLINE,
  321. COMMAND """if %s = 0 then address doomgate slider ID TURB ATTRS '0x80423661' 1;
  322. else address doomgate slider ID TURB ATTRS '0x80423661' 0"""
  323.     slider ID TURB single HELP '"Turbo Amount"' ATTRS MUIA_Slider_Max 255 MUIA_Slider_Min 1
  324.     endgroup
  325. endgroup
  326. endgroup
  327. group horiz
  328. group
  329. label '"Other"'
  330. endgroup
  331. group
  332. string ID COTH help '"Specify your own Commandline..."' ATTRS MUIA_CycleChain 1,
  333. Command """address command;
  334. 'setenv DoomGate/OtherLineOptions 'd2c(34)' %s 'd2c(34) """ port inline
  335. endgroup
  336. endgroup 
  337. endgroup 
  338. group frame ATTRS MUIA_Group_Columns 2 label "Quick Setups"
  339. button ID TPLA single help '"Set up for DeathMatch"' port INLINE,
  340. command """address DOOMGATE;
  341. radio  ID NAMT ATTRS   0x80429b41 0;
  342. check  ID CDEA ATTRS   0x8042654b 0;
  343. check  ID CNOM ATTRS   0x8042654b 0;
  344. check  ID CEXT ATTRS   0x8042654b 0;""" label "One Player"
  345. button ID TPLA single help '"Set up for DeathMatch"' port INLINE,
  346. command """address DOOMGATE;
  347. check  ID CDEV ATTRS   0x8042654b TRUE;
  348. check  ID CDEA ATTRS   0x8042654b TRUE;
  349. check  ID CNOM ATTRS   0x8042654b TRUE;
  350. check  ID CEXT ATTRS   0x8042654b TRUE;
  351. group  ID MAIR ATTRS   0x80424199 '3' ;
  352. radio  ID NAMT ATTRS   0x80429b41 '1' """ label "Two Player"
  353. endgroup
  354. group frame label "Executable/Buffers/Stack"
  355. group horiz
  356. group
  357. group horiz
  358.     group
  359.         List ID PLST TITLE """\033bPort"""
  360.         Button ID PLSB label "No Port Selected"
  361.     endgroup
  362. endgroup
  363. endgroup
  364.     group ATTRS MUIA_Group_Columns 2
  365.         group frame label "Buffers"
  366.         knob ID BUFS help '"Drive Buffers to Ensure are on This Drive"' ATTRS MUIA_Slider_Max 2000 MUIA_Slider_Min 100 Command '"setenv DoomGate/Buffers %s"' port command
  367.         endgroup
  368.         group frame label "Stack"
  369.         knob ID STAC help '"System Stack to Set before Starting DOOM"' ATTRS MUIA_Slider_Max 51200 MUIA_Slider_Min 4096 Command '"setenv DoomGate/Stack %s"' port command
  370.         endgroup
  371.     endgroup
  372. endgroup
  373. endgroup
  374. endgroup 
  375. group 
  376. group register labels 'Doom FAQ,Cheats,DGate Author,Credits'
  377. group 
  378. group register labels 'Misc FAQ,WADS ?!?'
  379. group
  380. view file "data/faq.txt"
  381. endgroup
  382. group
  383. view file "data/wads.txt"
  384. endgroup
  385. endgroup
  386. endgroup 
  387. group 
  388. view file "data/cheat.txt"
  389. endgroup 
  390. group 
  391. view file "data/author.txt"
  392. endgroup 
  393. group 
  394. view file "data/credits.txt"
  395. endgroup 
  396. endgroup 
  397. endgroup
  398. group 
  399. group register labels 'Ports,.doomrc'
  400. group 
  401. view file "data/conf_ports.txt"
  402. object CLASS '"Balance.mui"'
  403. group scroll frame label "Ports Currently Configured"
  404. if ports.0 = "-1" then do
  405. button label "Error Loading Ports Data"
  406. end
  407. else do i=1 for ports.0
  408. group label ports.i
  409. button label exe.i "\n" dir.i
  410. endgroup
  411. end
  412. endgroup
  413. button port command command """ed data/DoomPorts.data""" label "Edit Configuration"
  414. endgroup 
  415. group 
  416. group ATTRS MUIA_Group_Columns 2
  417.     label ".doomrc"
  418.     group ATTRS MUIA_Group_Columns 2
  419.     button ID RCLO command """DoomGATE.rexx DOOMRCLOAD""" label "Load .doomrc"
  420.     button ID RCSA command """DoomGATE.rexx DOOMRCSAVE""" label "Save .doomrc"
  421.     endgroup
  422. endgroup
  423. group register labels "Chat,Misc,Keys"
  424. group scroll ATTRS MUIA_Group_Columns 2
  425.     label "Chat 0"
  426.     string ID CHT0 ATTRS MUIA_CycleChain 1
  427.     label "Chat 1"
  428.     string ID CHT1 ATTRS MUIA_CycleChain 1
  429.     label "Chat 2"
  430.     string ID CHT2 ATTRS MUIA_CycleChain 1
  431.     label "Chat 3"
  432.     string ID CHT3 ATTRS MUIA_CycleChain 1
  433.     label "Chat 4"
  434.     string ID CHT4 ATTRS MUIA_CycleChain 1
  435.     label "Chat 5"
  436.     string ID CHT5 ATTRS MUIA_CycleChain 1
  437.     label "Chat 6"
  438.     string ID CHT6 ATTRS MUIA_CycleChain 1
  439.     label "Chat 7"
  440.     string ID CHT7 ATTRS MUIA_CycleChain 1
  441.     label "Chat 8"
  442.     string ID CHT8 ATTRS MUIA_CycleChain 1
  443.     label "Chat 9"
  444.     string ID CHT9 ATTRS MUIA_CycleChain 1
  445. endgroup
  446. group scroll ATTRS MUIA_Group_Columns 2
  447.     label "Note..."
  448.     button label "Some of these sliders go from\n0 to 100. Obviously most of this range\nis wrong -- however the correct range\nis not known yet :-)"
  449.     label "Sfx Volume"
  450.     slider ID SSFX ATTRS MUIA_CycleChain 1
  451.     label "Music Volume"
  452.     slider ID SMUS ATTRS MUIA_CycleChain 1
  453.     label "Sound Channels"
  454.     slider ID SSOU ATTRS MUIA_CycleChain 1 MUIA_Slider_Min 0 MUIA_Slider_Max 8
  455.     label "Detail Level"
  456.     cycle ID SDET ATTRS MUIA_CycleChain 1 labels "Low,High"
  457.     label "Gamma Correct"
  458.     slider ID SGAM ATTRS MUIA_CycleChain 1 MUIA_Slider_Min 0 MUIA_Slider_Max 4
  459.     label "Screen Blocks"
  460.     slider ID SSCR ATTRS MUIA_CycleChain 1
  461.     label "Show Messages"
  462.     cycle ID SSHO ATTRS MUIA_CycleChain 1 labels "No,Yes"
  463.     label "Mouse Sensitivity"
  464.     slider ID SMOS ATTRS MUIA_CycleChain 1
  465. endgroup
  466. group 
  467. group scroll ATTRS MUIA_Group_Columns 2
  468.     label "Note..."
  469.     button label "Actual playing keys will be\non this page soon. For now\njust edit the .doomrc manually :-)"
  470.     label "Use Mouse"
  471.     cycle ID SUMO ATTRS MUIA_CycleChain 1 labels "No,Yes"
  472.     label "Use Joystick"
  473.     cycle ID SUJO ATTRS MUIA_CycleChain 1 labels "No,Yes"
  474. endgroup
  475. endgroup 
  476. endgroup 
  477. endgroup 
  478. endgroup 
  479. endgroup 
  480. group 
  481. group horiz
  482. view file "data/network.txt"
  483. group
  484. group horiz
  485. label "New Port:"
  486.     check ID NPRC HELP '"Use a different TCP/IP Port to normal"' PORT INLINE,
  487. COMMAND """if %s = 0 then address doomgate string ID NPRS ATTRS '0x80423661' 1;
  488. else address doomgate string ID NPRS ATTRS '0x80423661' 0"""
  489. endgroup
  490. string ID NPRS help '"Port to use"' ATTRS MUIA_Disabled TRUE
  491. endgroup
  492. endgroup
  493. group horiz
  494.     group frame label "N"
  495. radio ID NAMT PORT INLINE,
  496.             COMMAND """address DOOMGATE;options results;
  497. num = %s;
  498. 'setvar nodes ' num;
  499. 'group ID NETG ATTRS 0x80429ba8 0';
  500. call ca(5);
  501. call oa(num);
  502. 'group ID NETG ATTRS 0x80429ba8 1';
  503. exit;
  504. ca:;
  505. do i=1 for arg(1);
  506. 'group ID GND'i' ATTRS 0x80429ba8 0';
  507. end;
  508. return 0;
  509. oa:;
  510. do i=1 for arg(1);
  511. 'group ID GND'i' ATTRS 0x80429ba8 1';
  512. end;
  513. return 0;
  514. """ ATTRS MUIA_CycleChain 1 HELP '"Number of Players/Nodes"' LABELS '1,2,3,4,5'
  515.     endgroup
  516.     group frame label "P"
  517. radio ID NAMP PORT INLINE,
  518.             COMMAND """options results;address DOOMGATE;
  519. num = %s;
  520. 'setvar player 'num;
  521. 'getvar nodes';
  522. nodes = result;
  523. if num > nodes then do;
  524. nnum = num - 1;
  525. 'radio ID NAMT ATTRS 0x80429b41 'nnum;
  526. end;
  527. do i=1 for 5;
  528. call o(i,0);
  529. end;
  530. call o(num,1);
  531. exit;
  532. o:;
  533. 'group ID GND'arg(1)' ATTRS 0x80423661 'arg(2);
  534. return;""" ATTRS MUIA_CycleChain 1 HELP '"Player/Node Number of This Machine"' LABELS '1,2,3,4,5'
  535.     endgroup
  536. space
  537.     group ID GND frame label "Hostname/IP Information"
  538. group ID NETG
  539.     group ID GND1 ATTRS MUIA_Group_Columns 2 ATTRS MUIA_Disabled 1
  540.     label "Node 1 IP/Hostname"
  541.     string ID NOD1  ATTRS MUIA_CycleChain 1
  542.     endgroup
  543.     
  544.     group ID GND2 ATTRS MUIA_Group_Columns 2 MUIA_ShowMe FALSE
  545.     label "Node 2 IP/Hostname"
  546.     string ID NOD2  ATTRS MUIA_CycleChain 1
  547.     endgroup
  548.     group ID GND3 ATTRS MUIA_Group_Columns 2 MUIA_ShowMe FALSE
  549.     label "Node 3 IP/Hostname"
  550.     string ID NOD3 ATTRS MUIA_CycleChain 1
  551.     endgroup
  552.     group ID GND4 ATTRS MUIA_Group_Columns 2 MUIA_ShowMe FALSE
  553.     label "Node 4 IP/Hostname"
  554.     string ID NOD4 ATTRS MUIA_CycleChain 1
  555.     endgroup
  556.     group ID GND5 ATTRS MUIA_Group_Columns 2 MUIA_ShowMe FALSE
  557.     label "Node 5 IP/Hostname"
  558.     string ID NOD5 ATTRS MUIA_CycleChain 1
  559.     endgroup
  560. endgroup
  561.     space horiz
  562.     endgroup
  563. endgroup
  564. group horiz frame label "Fetch/Offer Settings"
  565. button ID FOSO help '"Allow someone else to view your settings"' label 'Offer'
  566. button ID FOSF help '"View the Settings used on a remote machine"' label 'Fetch'
  567. button ID FOSU help '"Attempt to fix this if its knackered"' label 'UnBodge'
  568. object ID FOSB CLASS '"Busy.mcc"'  ATTRS MUIA_Busy_Speed 0
  569. endgroup
  570. endgroup 
  571. group 
  572. group horiz frame label "Main WAD"
  573. view string "If your WAD is the Ultimate DOOM then select 4. Otherwise select 3. Then save your prefs and quit\nand restart DoomGATE to reflect this change."
  574. radio ID WEPI ATTRS MUIA_CycleChain 1 HELP '"Number of Episodes in this WAD"' PORT Command COMMAND '"setenv DoomGate/Episodes %s"' LABELS '3,4'
  575. endgroup
  576. group frame label "Custom WADS"
  577. list ID WLST NODUP TITLE """\033bWAD Name,\033bWad File,\033bEpisode,\033bLevel""" ATTRS MUIA_List_Format """MIW=25 BAR,MIW=25 BAR,MIW=10 BAR,MIW=10""" MUIA_List_DragSortable 1
  578. group
  579. group ATTRS MUIA_Group_Columns 5 MUIA_Weight 500 frame label "Add"
  580. string ID CWNA ATTRS MUIA_CycleChain 1
  581. popasl ID CWFI ATTRS MUIA_CycleChain 1
  582. popslider ID CWEP ATTRS MUIA_Slider_Min 1 MUIA_Slider_Max Max_Episode MUIA_CycleChain 1
  583. popslider ID CWLE ATTRS MUIA_Slider_Min 1 MUIA_Slider_Max 9 MUIA_CycleChain 1
  584. button ID CWAD ATTRS MUIA_Weight 10 MUIA_CycleChain 1 Label "Add"
  585. endgroup 
  586. group horiz
  587. group frame label "Del"
  588. button ID CWDE command '"list ID WLST REMOVE POS -1"' port DOOMGATE label "Remove"
  589. endgroup
  590. group frame label "Use"
  591. button ID CWUS label "Use"
  592. endgroup
  593. group frame ATTRS MUIA_Group_Columns 2 label "Lists"
  594. button ID CWLO label "Load"
  595. button ID CWSA label "Save"
  596. endgroup
  597. endgroup 
  598. endgroup
  599. endgroup 
  600. endgroup 
  601. endgroup
  602. group ATTRS MUIA_Group_Columns 2
  603. button ID STAR ATTRS MUIA_CycleChain 1 label 'Enter DOOM'
  604. button ID QUIT COMMAND '"quit"' PORT DOOMGATE label 'Exit DoomGATE'
  605. endgroup
  606. endwindow
  607. callhook ID PLST COMMAND """;
  608. options results;
  609. address DOOMGATE;
  610. list ID PLST;
  611. 'button ID PLSB label' result
  612. """ PORT INLINE ATTRS MUIA_List_Active MUIV_EveryTime
  613. callhook ID WLST COMMAND """;
  614. options results;
  615. address DOOMGATE;
  616. list ID WLST;
  617. parse var result name ',' file ',' episode ',' level;
  618. string ID CWNA CONTENT name;
  619. popasl ID CWFI CONTENT file;
  620. popslider ID CWEP "0x8042ae3a" episode;
  621. popslider ID CWLE "0x8042ae3a" level;
  622. """ PORT INLINE ATTRS MUIA_List_Active MUIV_EveryTime
  623. callhook ID CWAD PRESS PORT INLINE COMMAND """options results;address DOOMGATE;
  624. string ID CWNA;
  625. name = result;
  626. popasl ID CWFI;
  627. file = result;
  628. popslider ID CWEP;
  629. episode = result;
  630. popslider ID CWLE;
  631. level = result;
  632. listline = name || ',' || file || ',' || episode || ',' || level ;
  633. list ID WLST NODUP INSERT STRING listline """
  634. callhook ID CWUS PRESS PORT INLINE COMMAND """options results;address DOOMGATE;
  635. string ID CWNA;
  636. name = result;
  637. popasl ID CWFI;
  638. file = result;
  639. popslider ID CWEP;
  640. episode = result;
  641. popslider ID CWLE;
  642. level = result;
  643. group  ID MAIR ATTRS   0x80424199 '0' ;
  644. check  ID CFIL ATTRS   0x8042654b TRUE;
  645. popasl ID PFIL CONTENT file;
  646. check  ID CWAR ATTRS   0x8042654b TRUE;
  647. slider ID WARE ATTRS 0x8042ae3a episode;
  648. slider ID WARM ATTRS 0x8042ae3a level;"""
  649. callhook ID CWSA PRESS PORT INLINE COMMAND """options results;address DOOMGATE;
  650. list ID WLST 0x80421654;
  651. entries = result;
  652. call open(set,'env:DoomGATE/CustomWADS',w);
  653. i = 0;
  654. do until i = entries;
  655. list ID WLST POS i;
  656. call writeln(set,result);
  657. i = i + 1;
  658. if i = 100 then break;
  659. end;
  660. call close(set);"""
  661. callhook ID CWLO PRESS PORT INLINE COMMAND """options results;address DOOMGATE;
  662. if open(set,'env:DoomGATE/CustomWADS',r) then do;
  663. do until eof(set);
  664. list ID WLST NODUP INSERT STRING readln(set);
  665. end;
  666. call close(set);
  667. end;"""
  668. callhook ID STAR PRESS PORT INLINE,
  669. COMMAND """DOOMGATE.rexx STARTDOOM"""
  670. callhook ID FOSO PRESS PORT INLINE,
  671. COMMAND """DOOMGATE.rexx OFFERDETAILS"""
  672. callhook ID FOSF PRESS COMMAND '"DoomGATE.rexx SETTINGSFETCHWIN"'
  673. callhook ID FOSU PRESS COMMAND '"DoomGATE.rexx SETTINGSUNBODGE"'
  674. Address DOOMGATE
  675. EpisodesC = 0
  676. If Max_Episode = 4 then EpisodesC = 1
  677. call SetGUIOptions()
  678. EXIT
  679. Tags:
  680. MUIM_Notify = 0x8042c9cb
  681. MUIM_Set = 0x8042549a
  682. MUIM_NoNotifySet = 0x8042216f
  683. MUIM_Application_AboutMUI = 0x8042d21d
  684. MUIM_Application_OpenConfigWindow = 0x804299ba
  685. MUIA_Application_Sleep =               0x80425711 
  686. MUIA_Slider_Level =                         0x8042ae3a 
  687. MUIA_AppMessage =                      0x80421955 
  688. MUIA_Dropable =                        0x8042fbce 
  689. MUIA_Draggable =             0x80420b6e
  690. MUIA_Listview_DragType = 0x80425cd3
  691. MUIA_List_Format =                     0x80423c0a 
  692. MUIA_FillArea =                        0x804294a3 
  693. MUIA_Frame =                           0x8042ac64 
  694. MUIA_Weight =                          0x80421d1f 
  695. MUIA_Gauge_Current =                   0x8042f0dd 
  696. MUIA_Gauge_Divide =                    0x8042d8df 
  697. MUIA_Gauge_Horiz =                     0x804232dd 
  698. MUIA_Gauge_Max =                       0x8042bcdb 
  699. MUIA_Numeric_Value = 0x8042ae3a
  700. MUIA_Menuitem_Title = 0x804218be
  701. MUIA_Menuitem_Shortcut =               0x80422030 
  702. MUIA_Boopsi_MinHeight =                0x80422c93 
  703. MUIA_Boopsi_MinWidth =                 0x80428fb2 
  704. MUIA_Boopsi_Remember =                 0x8042f4bd 
  705. MUIA_Boopsi_TagScreen =                0x8042bc71 
  706. WHEEL_Hue =                            0x84000001
  707. WHEEL_Saturation =                     0x84000002
  708. WHEEL_Screen =                         0x84000009
  709. MUIA_Slider_Max =                      0x8042d78a 
  710. MUIA_Slider_Min =                      0x8042e404 
  711. MUIA_Selected =                        0x8042654b 
  712. MUIA_CycleChain =                      0x80421ce7 
  713. MUIA_String_Reject =                   0x8042179c 
  714. MUIA_Gauge_Max =                       0x8042bcdb 
  715. MUIA_Group_ActivePage =                0x80424199 
  716. MUIA_Group_Child =                     0x804226e6 
  717. MUIA_Group_ChildList =                 0x80424748 
  718. MUIA_Group_Columns =                   0x8042f416 
  719. MUIA_Group_Horiz =                     0x8042536b 
  720. MUIA_Group_HorizSpacing =              0x8042c651 
  721. MUIA_Group_LayoutHook =                0x8042c3b2 
  722. MUIA_Group_PageMode =                  0x80421a5f 
  723. MUIA_Group_Rows =                      0x8042b68f 
  724. MUIA_Group_SameHeight =                0x8042037e 
  725. MUIA_Group_SameSize =                  0x80420860 
  726. MUIA_Group_SameWidth =                 0x8042b3ec 
  727. MUIA_Group_Spacing =                   0x8042866d 
  728. MUIA_Group_VertSpacing =               0x8042e1bf 
  729. MUIA_Disabled =                        0x80423661 
  730. MUIA_ShowMe = 0x80429ba8
  731. ASLFR_DrawersOnly =                    0x8008002F
  732. ASLFR_RejectIcons =                    0x8008003C
  733. ASLFR_TitleText =                      0x80080001
  734. MUIA_Cycle_Active =                    0x80421788 
  735. MUIA_List_Active =                     0x8042391c 
  736. MUIA_List_AdjustHeight =               0x8042850d 
  737. MUIA_List_AdjustWidth =                0x8042354a 
  738. MUIA_List_AutoVisible =                0x8042a445 
  739. MUIA_List_CompareHook =                0x80425c14 
  740. MUIA_List_ConstructHook =              0x8042894f 
  741. MUIA_List_DestructHook =               0x804297ce 
  742. MUIA_List_DisplayHook =                0x8042b4d5 
  743. MUIA_List_DragSortable =               0x80426099 
  744. MUIA_List_DropMark =                   0x8042aba6 
  745. MUIA_List_Entries =                    0x80421654 
  746. MUIA_List_First =                      0x804238d4 
  747. MUIA_List_Format =                     0x80423c0a 
  748. MUIA_List_InsertPosition =             0x8042d0cd 
  749. MUIA_List_MinLineHeight =              0x8042d1c3 
  750. MUIA_List_MultiTestHook =              0x8042c2c6 
  751. MUIA_List_Pool =                       0x80423431 
  752. MUIA_List_PoolPuddleSize =             0x8042a4eb 
  753. MUIA_List_PoolThreshSize =             0x8042c48c 
  754. MUIA_List_Quiet =                      0x8042d8c7 
  755. MUIA_List_ShowDropMarks =              0x8042c6f3 
  756. MUIA_List_SourceArray =                0x8042c0a0 
  757. MUIA_List_Title =                      0x80423e66 
  758. MUIA_List_Visible =                    0x8042191f 
  759. MUIA_Busy_Speed        =  0x80020049
  760. MUIV_EveryTime = 0x49893131
  761. MUIV_List_Insert_Bottom = -3
  762. TRUE = 1
  763. FALSE = 0
  764. MUIV_Listview_DragType_None = 0
  765. MUIV_Listview_DragType_Immediate = 1
  766. MUIV_Frame_None = 0
  767. MUIV_Frame_Text = 3
  768. MUIV_TriggerValue = 0x49893131
  769. MUIV_EveryTime = 0x49893131
  770. Return 0
  771. DOOMRC: 
  772.     address command 'echo >'ID '$HOME'
  773.     if open(cnf,ID,'R') then do
  774.         home=trim(readln(cnf))
  775.         call close(cnf)
  776.         address command 'delete >nil: 'ID
  777.         end
  778.     if (home='$HOME' | home='HOME') then home=''
  779.     else if right(home,1)~='/' then home=home||'/'
  780. if ~exists(home".doomrc") then do
  781.     call LoadPortsData()
  782.     if ports.0 ~= -1 then do
  783.         address doomgate
  784.         button id PLSB
  785.         useme = result
  786.         do i=1 for ports.0
  787.           if ports.i = useme then home = dir.i
  788.         end
  789.     
  790.     end
  791. end
  792. if ~exists(home".doomrc") then do
  793.     say "Unable to locate .doomrc file. Looked in $home and "dir.i
  794. end
  795. rcloc = home
  796. address doomgate
  797. button ID RCLO ATTRS MUIA_Disabled 1
  798. button ID RCSA ATTRS MUIA_Disabled 1
  799. call open(file,rcloc".doomrc",r)
  800. i = 1
  801. do until eof(file)
  802. line.i = readln(file)
  803. i = i + 1
  804. end
  805. line.0 = i - 1
  806. if arg(1)=READ then lors = L
  807. if arg(1)=SAVE then lors = S
  808. call ch("chatmacro0",CHT0,lors)
  809. call ch("chatmacro1",CHT1,lors)
  810. call ch("chatmacro2",CHT2,lors)
  811. call ch("chatmacro3",CHT3,lors)
  812. call ch("chatmacro4",CHT4,lors)
  813. call ch("chatmacro5",CHT5,lors)
  814. call ch("chatmacro6",CHT6,lors)
  815. call ch("chatmacro7",CHT7,lors)
  816. call ch("chatmacro8",CHT8,lors)
  817. call ch("chatmacro9",CHT9,lors)
  818. call ch("sfx_volume",SSFX,lors,s)
  819. call ch("music_volume",SMUS,lors,s)
  820. call ch("snd_channels",SSOU,lors,s)
  821. call ch("detaillevel",SDET,lors,c)
  822. call ch("usegamma",SGAM,lors,s)
  823. call ch("screenblocks",SSCR,lors,s)
  824. call ch("show_messages",SSHO,lors,c)
  825. call ch("mouse_sensitivity",SMOS,lors,s)
  826. call ch("use_mouse",SUMO,lors,c)
  827. call ch("use_joystick",SUJO,lors,c)
  828. call close(file)
  829. call open(file,rcloc".doomrc",W)
  830. i = 1
  831. do until i = line.0
  832.     call writeln(file,line.i)
  833. i = i + 1
  834. end
  835. call close(file)
  836. address doomgate
  837. button ID RCLO ATTRS MUIA_Disabled 0
  838. button ID RCSA ATTRS MUIA_Disabled 0
  839. return 0
  840. ch: 
  841. searchingfor = arg(1)
  842. stringid = arg(2)
  843. saveorload = arg(3)
  844. ischat = pos("chatmacro",searchingfor)
  845. type = arg(4)
  846. i = 1
  847. do until i = line.0
  848. if upper(left(line.i,length(searchingfor))) = upper(searchingfor) then do
  849.     if  ischat then parse var line.i RUBBISH '"' Setting '"'
  850.     if ~ischat then parse var line.i RUBBISH "    " Setting
  851.     if ~ischat then Setting = Compress(Setting,"    , ")
  852.     WASATLINE = i
  853.     if saveorload = L then do
  854.         select
  855.         when type = S then Address DOOMGATE slider ID stringid ATTRS MUIA_Slider_Level setting
  856.         when type = C then Address DOOMGATE  cycle ID stringid ATTRS MUIA_Cycle_Active setting
  857.         otherwise Address DOOMGATE string ID stringid content setting
  858.         end
  859.     end
  860.     if saveorload = S then do
  861.         select
  862.         when type = S then    address DOOMGATE slider ID stringid
  863.         when type = C then     address DOOMGATE cycle  ID stringid
  864.         otherwise    address DOOMGATE string ID stringid
  865.         end
  866.         changeto=result
  867.         if upper(changeto) = upper("High") then changeto = 1
  868.         if upper(changeto) = upper("Low")  then changeto = 0
  869.         if upper(changeto) = upper("No")   then changeto = 0
  870.         if upper(changeto) = upper("Yes")  then changeto = 1
  871.         if ~ischat then line.i = searchingfor"        "changeto
  872.         if  ischat then line.i = searchingfor"        "'"'changeto'"'
  873.     end
  874. end
  875. i = i + 1
  876. end
  877. return
  878. GetEnv: procedure
  879. if show('L', 'rexxarplib.library') then
  880. return 'GetEnv'(arg(1))
  881. if open(6Env, 'env:'arg(1), 'R') then do
  882. EnvVar = readln(6Env)
  883. call close 6Env
  884. end
  885. else EnvVar = ''
  886. return EnvVar
  887. getchecks: 
  888. if ~open(lines,'data/CommandLines.data',R) then do
  889.     say "Unable to Open data/CommandLines.data... Please reinstall."
  890.     return 1
  891. end
  892. do until eof(lines)
  893.     line = readln(lines)
  894.     parse var line flag idname labelname "*" helpname "*"
  895.     if length(idname) = 4 then do
  896.         labelname = compress(labelname,'    ')
  897.         call c(idname,' 'labelname)
  898.     end
  899. end
  900. call close(lines)
  901. return 1
  902. GetChecksIntoGUI: 
  903. if ~open(lines,'data/CommandLines.data',R) then do
  904.     button label "Unable to Open\ndata/CommandLines.data\nPlease reinstall."
  905.     return 1
  906. end
  907. do until eof(lines)
  908.     line = readln(lines)
  909.     parse var line flag idname labelname "*" helpname "*"
  910.     if length(idname) = 4 then do
  911.         labelname = compress(labelname)
  912.         label single labelname
  913.         check ID idname single help '"' helpname '"'
  914.     end
  915. end
  916. call close(lines)
  917. return 1
  918. SetGUIOptions: 
  919. if ports.0 ~= -1 then do
  920.     do i=1 for ports.0
  921.       list id PLST NODUB insert string ports.i
  922.     end
  923. button id PLSB label ports.1
  924. end
  925. else do
  926.     list id PLST NODUB insert string "Error Loading Data"
  927.     button id PLSB label "data/DoomPorts.data is missing"
  928.     button id STAR ATTRS MUIA_Disabled 1
  929. end
  930.     radio  ID WEPI ATTRS   '0x80429b41' EpisodesC
  931.     popasl ID DD   CONTENT GetEnv("DoomGate/Doom_Directory")
  932.     popasl ID PFIL CONTENT GetEnv("DoomGate/Custom_WAD")
  933.     knob   ID BUFS ATTRS   MUIA_Slider_Level GetEnv("DoomGate/Buffers")
  934.     knob   ID STAC ATTRS   MUIA_Slider_Level GetEnv("DoomGate/Stack")
  935.     slider ID WARM ATTRS   MUIA_Disabled 1
  936.     slider ID WARE ATTRS   MUIA_Disabled 1
  937.     slider ID TURB ATTRS   MUIA_Disabled 1
  938.     slider ID SKIL ATTRS   MUIA_Disabled 1
  939.     
  940.     popasl ID PFIL ATTRS   MUIA_Disabled 1
  941. if ~open(lines,'data/CommandLines.data',R) then do
  942.     button label "Unable to Open\ndata/CommandLines.data\nPlease reinstall."
  943.     return 1
  944. end
  945. do until eof(lines)
  946.     line = readln(lines)
  947.     parse var line flag idname labelname "*" helpname "*"
  948.     if length(idname) = 4 then do
  949.         if flag = 1 then do
  950.             check ID idname ATTRS MUIA_Selected 1
  951.         end
  952.     end
  953. end
  954. call close(lines)
  955. return 1
  956.     c:;address DOOMGATE;check id arg(1);
  957.     if result = 1 then ct = ct || arg(2);
  958.     return 0;
  959.     exit
  960. LoadPortsData:
  961. if ~open(data,'data/DoomPorts.data',r) then do
  962. ports.0 = -1
  963. return 0
  964. end
  965. do until eof(data)
  966.     line = readln(data)
  967.     if left(line,2) = "##" then break
  968. end
  969. do until eof(data)
  970.     line = readln(data)
  971.     if left(line,2) = "##" then break
  972. end
  973. ports.0 = 0
  974. i    = 0
  975. do until eof(data)
  976.     do until eof(data)
  977.         line = readln(data)
  978.         if left(line,1) = "#" then break
  979.     end
  980.     i = i + 1
  981.     ports.0 = i
  982.     ports.i = readln(data)
  983.     exe.i   = readln(data)
  984.     dir.i   = readln(data)
  985. end
  986. ports.0 = ports.0 - 1
  987. call close(data)
  988. return 0
  989.